#include <iostream>
#include <QCoreApplication>
#include <QPluginLoader>
#include <QDebug>
#include <QApplication>
#include <QDir>

#include "IMessage.h"
#include "MainWindow.h"
#include "manage/PluginManger.h"
#include "plugins/IDataBasePlugin.h"
#include "plugins/IDataBasePlugin.h"

class QObject;

int main(int argc, char *argv[]) {
    QApplication app(argc, argv);

    // MainWindow window;
    // window.show();

    PluginManger instance = PluginManger::createInstance();
    instance.loadAllPlugins();
    IDatabasePlugin* database_plugin = instance.getPluginsByType<IDatabasePlugin*>(ISourcePlugin::DataBase,ISourcePlugin::Sqlite);
    database_plugin->initialize("gagg", "gagg.db", "QSQLITE");
    database_plugin->executeUpdate("create table if not exists test (id integer primary key autoincrement, name varchar(20))");
    database_plugin->executeUpdate("insert into test (name) values ('gagg')");
    auto variantses = database_plugin->executeQuery("select * from test");
    qDebug()<<variantses;

    return app.exec();
}
